import { useStore } from "@/store"

export function usePermission(pageName: any, hanldeName: string) {
  const store = useStore()
  const permissions = store.state.login.permissions
  // 根据后端权限拼接
  const verifyPermission = `system:${pageName}:${hanldeName}`
  // !! 处理返回（布尔值）
  return !!permissions.find((item) => item == verifyPermission)
}
